package net.mysoft.budgetsoft.system.domain;

import java.util.Date;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

/**   
 *  
 * @author dagongPGP v1.0 
 * @link <a href=http://www.mysoft.net>北京大公信软科技有限公司</a> 
 *  
 * @version $Revision: 1.00  $Date: 2013-07-08 17:26:47 
 */
//@Entity
//@Table(name="FlowTemplate")
public class TFlowTemplate implements java.io.Serializable {  
    private String ftl_ID;
    private String ftl_Name_cn;
    private String ftl_Name_en;
    private String ftl_Description;
    private Integer ftl_Valid;
    private String ftc_ID;
    private String ftl_CreateUserID;
    private Date ftl_CreateTime;
    private String ftl_UpdateUserID;
    private Date ftl_UpdateTime;
    private Set<TFlowTemplateNode> flowTemplateNodeSet;
    
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy="flowTemplate")
	public Set<TFlowTemplateNode> getFlowTemplateNodeSet() {
		return flowTemplateNodeSet;
	}

	public void setFlowTemplateNodeSet(Set<TFlowTemplateNode> flowTemplateNodeSet) {
		this.flowTemplateNodeSet = flowTemplateNodeSet;
	}

	@Id 
	@GeneratedValue(generator = "IDGenerator")
	@GenericGenerator(name = "IDGenerator", strategy = "net.mysoft.framework.util.IDGenerator", 
			parameters = { @Parameter(value = "SEQ_FTL_T", name = "seq")})
    @Column(name="FTL_ID", unique=true, nullable=false)
    public String getFtl_ID(){
    	return this.ftl_ID;
    }
    
    public void setFtl_ID(String fTL_ID){
    	this.ftl_ID = fTL_ID;
    }
    
    @Column(name="FTL_Name_cn")
    public String getFtl_Name_cn(){
    	return this.ftl_Name_cn;
    }
    
    public void setFtl_Name_cn(String fTL_Name_cn){
    	this.ftl_Name_cn = fTL_Name_cn;
    }
    
    @Column(name="FTL_Name_en")
    public String getFtl_Name_en(){
    	return this.ftl_Name_en;
    }
    
    public void setFtl_Name_en(String fTL_Name_en){
    	this.ftl_Name_en = fTL_Name_en;
    }
    
    @Column(name="FTL_Description")
    public String getFtl_Description(){
    	return this.ftl_Description;
    }
    
    public void setFtl_Description(String fTL_Description){
    	this.ftl_Description = fTL_Description;
    }
    
    @Column(name="FTL_Valid")
    public Integer getFtl_Valid(){
    	return this.ftl_Valid;
    }
    
    public void setFtl_Valid(Integer fTL_Valid){
    	this.ftl_Valid = fTL_Valid;
    }

    @Column(name="FTC_ID")
	public String getFtc_ID() {
		return ftc_ID;
	}

	public void setFtc_ID(String ftc_ID) {
		this.ftc_ID = ftc_ID;
	}
	@Column(name="FTL_CreateUserID")
	public String getFtl_CreateUserID() {
		return ftl_CreateUserID;
	}

	public void setFtl_CreateUserID(String ftl_CreateUserID) {
		this.ftl_CreateUserID = ftl_CreateUserID;
	}
	@Column(name="FTL_CreateTime")
	public Date getFtl_CreateTime() {
		return ftl_CreateTime;
	}

	public void setFtl_CreateTime(Date ftl_CreateTime) {
		this.ftl_CreateTime = ftl_CreateTime;
	}
	@Column(name="FTL_UpdateUserID")
	public String getFtl_UpdateUserID() {
		return ftl_UpdateUserID;
	}

	public void setFtl_UpdateUserID(String ftl_UpdateUserID) {
		this.ftl_UpdateUserID = ftl_UpdateUserID;
	}
	@Column(name="FTL_UpdateTime")
	public Date getFtl_UpdateTime() {
		return ftl_UpdateTime;
	}

	public void setFtl_UpdateTime(Date ftl_UpdateTime) {
		this.ftl_UpdateTime = ftl_UpdateTime;
	}

	@Override
    public int hashCode() {
    	int prime = 0;
        prime +=this.getFtl_ID().hashCode();
        return prime;
    }

    @Override
    public boolean equals(Object obj) {
    	boolean isEquals = false;
    	if(obj!=null&&this.getClass()==obj.getClass()){
    		TFlowTemplate clazz = (TFlowTemplate)obj;
            if(clazz.getFtl_ID().equals(this.getFtl_ID()))
            	isEquals = true;
    		return isEquals;
    	}
        return isEquals;
    }

}